﻿// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_SEC_USER
// * CreateDate    : 2011/8/5 11:36:42
// * Creater       : CodeSmith
// * LastChangeDate: 2011/8/5 11:36:42
// * LastChanger   : 2011/8/5 11:36:42
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class SecUserEntity : EntityBase
    {
        public SecUserTable TableSchema
        {
            get
            {
                return SecUserTable.Current;
            }
        }

        public SecUserEntity()
        {

        }

        public SecUserEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.UserId = Convert.ToString(CommonFunctions.ToObject(dr["USER_ID"]));
            this.PersonId = Convert.ToString(CommonFunctions.ToObject(dr["PERSON_ID"]));
            this.UserAccount = Convert.ToString(CommonFunctions.ToObject(dr["USER_ACCOUNT"]));
            this.ChineseName = Convert.ToString(CommonFunctions.ToObject(dr["CHINESE_NAME"]));
            this.EnglishName = Convert.ToString(CommonFunctions.ToObject(dr["ENGLISH_NAME"]));
            this.Password = Convert.ToString(CommonFunctions.ToObject(dr["PASSWORD"]));
            this.PasswordModifyDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["PASSWORD_MODIFY_DATE"]));
            this.Password1 = Convert.ToString(CommonFunctions.ToObject(dr["PASSWORD1"]));
            this.Password2 = Convert.ToString(CommonFunctions.ToObject(dr["PASSWORD2"]));
            this.IsDelete = Convert.ToDecimal(CommonFunctions.ToObject(dr["IS_DELETE"]));
            this.IsLock = Convert.ToDecimal(CommonFunctions.ToObject(dr["IS_LOCK"]));
            this.Position = Convert.ToString(CommonFunctions.ToObject(dr["POSITION"]));
            this.UserType = Convert.ToDecimal(CommonFunctions.ToObject(dr["USER_TYPE"]));
            this.MobilePhone = Convert.ToString(CommonFunctions.ToObject(dr["MOBILE_PHONE"]));
            this.Phone = Convert.ToString(CommonFunctions.ToObject(dr["PHONE"]));
            this.Email = Convert.ToString(CommonFunctions.ToObject(dr["EMAIL"]));
            this.Address = Convert.ToString(CommonFunctions.ToObject(dr["ADDRESS"]));
            this.Gender = Convert.ToDecimal(CommonFunctions.ToObject(dr["GENDER"]));
            this.CityId = Convert.ToString(CommonFunctions.ToObject(dr["CITY_ID"]));
            this.ResponsibleArea = Convert.ToString(CommonFunctions.ToObject(dr["RESPONSIBLE_AREA"]));
            this.Department = Convert.ToString(CommonFunctions.ToObject(dr["DEPARTMENT"]));
            this.Postal = Convert.ToString(CommonFunctions.ToObject(dr["POSTAL"]));
            this.Theme = Convert.ToString(CommonFunctions.ToObject(dr["THEME"]));
            this.BackupField1 = Convert.ToString(CommonFunctions.ToObject(dr["BACKUP_FIELD1"]));
            this.BackupField2 = Convert.ToString(CommonFunctions.ToObject(dr["BACKUP_FIELD2"]));
            this.BackupField3 = Convert.ToString(CommonFunctions.ToObject(dr["BACKUP_FIELD3"]));
            this.ValidateType = Convert.ToDecimal(CommonFunctions.ToObject(dr["VALIDATE_TYPE"]));
            this.LastModifiedBy = Convert.ToString(CommonFunctions.ToObject(dr["LAST_MODIFIED_BY"]));
            this.LastModifiedTime = Convert.ToDateTime(CommonFunctions.ToObject(dr["LAST_MODIFIED_TIME"]));
            this.CompanyCode = Convert.ToString(CommonFunctions.ToObject(dr["COMPANY_CODE"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return SecUserTable.Current;
            }
        }

        #region Perporty List
        public string UserId
        {
            get { return Convert.ToString(GetData(SecUserTable.C_USER_ID)); }
            set { SetData(SecUserTable.C_USER_ID, value); }
        }

        public string PersonId
        {
            get { return Convert.ToString(GetData(SecUserTable.C_PERSON_ID)); }
            set { SetData(SecUserTable.C_PERSON_ID, value); }
        }

        public string UserAccount
        {
            get { return Convert.ToString(GetData(SecUserTable.C_USER_ACCOUNT)); }
            set { SetData(SecUserTable.C_USER_ACCOUNT, value); }
        }

        public string ChineseName
        {
            get { return Convert.ToString(GetData(SecUserTable.C_CHINESE_NAME)); }
            set { SetData(SecUserTable.C_CHINESE_NAME, value); }
        }

        public string EnglishName
        {
            get { return Convert.ToString(GetData(SecUserTable.C_ENGLISH_NAME)); }
            set { SetData(SecUserTable.C_ENGLISH_NAME, value); }
        }

        public string Password
        {
            get { return Convert.ToString(GetData(SecUserTable.C_PASSWORD)); }
            set { SetData(SecUserTable.C_PASSWORD, value); }
        }

        public DateTime PasswordModifyDate
        {
            get { return Convert.ToDateTime(GetData(SecUserTable.C_PASSWORD_MODIFY_DATE)); }
            set { SetData(SecUserTable.C_PASSWORD_MODIFY_DATE, value); }
        }

        public string Password1
        {
            get { return Convert.ToString(GetData(SecUserTable.C_PASSWORD1)); }
            set { SetData(SecUserTable.C_PASSWORD1, value); }
        }

        public string Password2
        {
            get { return Convert.ToString(GetData(SecUserTable.C_PASSWORD2)); }
            set { SetData(SecUserTable.C_PASSWORD2, value); }
        }

        public decimal IsDelete
        {
            get { return Convert.ToDecimal(GetData(SecUserTable.C_IS_DELETE)); }
            set { SetData(SecUserTable.C_IS_DELETE, value); }
        }

        public decimal IsLock
        {
            get { return Convert.ToDecimal(GetData(SecUserTable.C_IS_LOCK)); }
            set { SetData(SecUserTable.C_IS_LOCK, value); }
        }

        public string Position
        {
            get { return Convert.ToString(GetData(SecUserTable.C_POSITION)); }
            set { SetData(SecUserTable.C_POSITION, value); }
        }

        public decimal UserType
        {
            get { return Convert.ToDecimal(GetData(SecUserTable.C_USER_TYPE)); }
            set { SetData(SecUserTable.C_USER_TYPE, value); }
        }

        public string MobilePhone
        {
            get { return Convert.ToString(GetData(SecUserTable.C_MOBILE_PHONE)); }
            set { SetData(SecUserTable.C_MOBILE_PHONE, value); }
        }

        public string Phone
        {
            get { return Convert.ToString(GetData(SecUserTable.C_PHONE)); }
            set { SetData(SecUserTable.C_PHONE, value); }
        }

        public string Email
        {
            get { return Convert.ToString(GetData(SecUserTable.C_EMAIL)); }
            set { SetData(SecUserTable.C_EMAIL, value); }
        }

        public string Address
        {
            get { return Convert.ToString(GetData(SecUserTable.C_ADDRESS)); }
            set { SetData(SecUserTable.C_ADDRESS, value); }
        }

        public decimal Gender
        {
            get { return Convert.ToDecimal(GetData(SecUserTable.C_GENDER)); }
            set { SetData(SecUserTable.C_GENDER, value); }
        }

        public string CityId
        {
            get { return Convert.ToString(GetData(SecUserTable.C_CITY_ID)); }
            set { SetData(SecUserTable.C_CITY_ID, value); }
        }

        public string ResponsibleArea
        {
            get { return Convert.ToString(GetData(SecUserTable.C_RESPONSIBLE_AREA)); }
            set { SetData(SecUserTable.C_RESPONSIBLE_AREA, value); }
        }

        public string Department
        {
            get { return Convert.ToString(GetData(SecUserTable.C_DEPARTMENT)); }
            set { SetData(SecUserTable.C_DEPARTMENT, value); }
        }

        public string Postal
        {
            get { return Convert.ToString(GetData(SecUserTable.C_POSTAL)); }
            set { SetData(SecUserTable.C_POSTAL, value); }
        }

        public string Theme
        {
            get { return Convert.ToString(GetData(SecUserTable.C_THEME)); }
            set { SetData(SecUserTable.C_THEME, value); }
        }

        public string BackupField1
        {
            get { return Convert.ToString(GetData(SecUserTable.C_BACKUP_FIELD1)); }
            set { SetData(SecUserTable.C_BACKUP_FIELD1, value); }
        }

        public string BackupField2
        {
            get { return Convert.ToString(GetData(SecUserTable.C_BACKUP_FIELD2)); }
            set { SetData(SecUserTable.C_BACKUP_FIELD2, value); }
        }

        public string BackupField3
        {
            get { return Convert.ToString(GetData(SecUserTable.C_BACKUP_FIELD3)); }
            set { SetData(SecUserTable.C_BACKUP_FIELD3, value); }
        }

        public decimal ValidateType
        {
            get { return Convert.ToDecimal(GetData(SecUserTable.C_VALIDATE_TYPE)); }
            set { SetData(SecUserTable.C_VALIDATE_TYPE, value); }
        }

        public string LastModifiedBy
        {
            get { return Convert.ToString(GetData(SecUserTable.C_LAST_MODIFIED_BY)); }
            set { SetData(SecUserTable.C_LAST_MODIFIED_BY, value); }
        }

        public DateTime LastModifiedTime
        {
            get { return Convert.ToDateTime(GetData(SecUserTable.C_LAST_MODIFIED_TIME)); }
            set { SetData(SecUserTable.C_LAST_MODIFIED_TIME, value); }
        }

        public string CompanyCode
        {
            get { return Convert.ToString(GetData(SecUserTable.C_COMPANY_CODE)); }
            set { SetData(SecUserTable.C_COMPANY_CODE, value); }
        }

        #endregion

        #region Customer Property
        public string DeleteFlagDesc
        {
            get 
            {
                if (IsDelete == 1)
                {
                    return DeleteFlag.删除.ToString();
                }
                else
                {
                    return DeleteFlag.可用.ToString();
                }
            }
        }
        public string LockedFlagDesc
        {
            get
            {
                if (IsLock == 1)
                {
                    return LockedFlag.已被锁.ToString();
                }
                else
                {
                    return LockedFlag.未锁.ToString();
                }
            }
        }
        public MstPersonEntity PersonEntity { get; set; }
        public string UserRoleCategory { get; set; }
        #endregion
    }


}

